module app.response.ResultMsg2;

import std.json;
import hunt.serialization.JsonSerializer;
import app.utils.RespCodeEnun;

/**
* 响应消息类，带token
*/
public class ResultMsg2
{
    @JsonProperty("code")
    RespCodeEnun code;
    string msg;
    string token;
    JSONValue data;

    this()
    {
    }

    this(RespCodeEnun code, string msg)
    {
        this.code = code;
        this.msg = msg;
    }

    this(RespCodeEnun code, string msg, string token)
    {
        this.code = code;
        this.msg = msg;
        this.token = token;
    }

    this(RespCodeEnun code, string msg, JSONValue data)
    {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    this(RespCodeEnun code, string msg, string[string] data)
    {
        this(code, msg, JSONValue(data));
    }
}
